//
//  UINavigationController+Honda.m
//  Honda
//
//  Created by Wang.Xinlei on 4/19/13.
//  Copyright (c) 2013 HeninHoo. All rights reserved.
//

#import "UINavigationController+Honda.h"

@implementation UINavigationController (Honda)

- (NSInvocation *)dismissInvocation {
    return nil;
}

@end


@implementation NavigationController

- (UIViewController *)popViewControllerAnimated:(BOOL)animated {
    UIViewController * viewController = [super popViewControllerAnimated:animated];
    if ([UIViewController invalid:viewController]) {
        [self.dismissInvocation invoke];
    }
    
    return viewController;
}

- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated {
    NSArray * array = [super popToRootViewControllerAnimated:animated];
    
    [self.dismissInvocation invoke];
    
    return array;
}

- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated {
    NSArray * array = [super popToViewController:viewController animated:animated];
    if ([UIViewController invalid:viewController]) {
        [self.dismissInvocation invoke];
    }
    
    return array;
}

-(BOOL)disablesAutomaticKeyboardDismissal
{
    return NO;
}
@end
